package swingAdv;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;

import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;

public class ImageFrame extends JFrame {
	BufferedImage image;

	public ImageFrame(final BufferedImage image) {
		this.image = image;
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				setSize(image.getWidth(null), image.getHeight(null));
				setVisible(true);
				repaint();
			}
		});
	}



	public void paint(Graphics g) {
		g.drawImage(image, 0, 0, null);
	}
}
